{$layout}
{$template "menu"}
{$template "/echarts"}

<div class="ui four columns grid">
    <div class="ui column">
        <h4>域名<link-icon href="/ns"></link-icon></h4>
        <div class="value"><span>{{board.countDomains}}</span>个</div>
    </div>
    <div class="ui column">
        <h4>记录<link-icon href="/ns"></link-icon></h4>
        <div class="value"><span>{{board.countRecords}}</span>个</div>
    </div>
    <div class="ui column">
        <h4>集群<link-icon href="/ns/clusters"></link-icon></h4>
        <div class="value"><span>{{board.countClusters}}</span>个</div>
    </div>
    <div class="ui column no-border">
        <h4>节点<link-icon href="/ns/clusters"></link-icon></h4>
        <div class="value"><span>{{board.countNodes}}</span>
            <span v-if="board.countOfflineNodes > 0" class="red" style="font-size: 1em">{{board.countOfflineNodes}}离线</span>
            <span v-else style="font-size: 1em">个</span>
        </div>
    </div>
</div>

<!-- 流量统计 -->
<div class="ui menu tabular">
    <a href="" class="item" :class="{active: trafficTab == 'hourly'}" @click.prevent="selectTrafficTab('hourly')">24小时流量趋势</a>
    <a href="" class="item" :class="{active: trafficTab == 'daily'}" @click.prevent="selectTrafficTab('daily')">15天流量趋势</a>
</div>


<!-- 按小时统计流量 -->
<div class="chart-box" id="hourly-traffic-chart" v-show="trafficTab == 'hourly'"></div>

<!-- 按日统计流量 -->
<div class="chart-box" id="daily-traffic-chart" v-show="trafficTab == 'daily'"></div>
<div class="ui divider"></div>

<!-- 域名排行 -->
<h4>域名访问排行 <span>（24小时）</span></h4>
<div class="chart-box" id="top-domains-chart"></div>
<div class="ui divider"></div>

<!-- 节点排行 -->
<h4>节点访问排行 <span>（24小时）</span></h4>
<div class="chart-box" id="top-nodes-chart"></div>
<div class="ui divider"></div>

<!-- 系统信息 -->
<div class="ui divider"></div>
<div class="ui menu tabular">
    <a href="" class="item" :class="{active: nodeStatusTab == 'cpu'}" @click.prevent="selectNodeStatusTab('cpu')">DNS节点CPU</a>
    <a href="" class="item" :class="{active: nodeStatusTab == 'memory'}" @click.prevent="selectNodeStatusTab('memory')">DNS节点内存</a>
    <a href="" class="item" :class="{active: nodeStatusTab == 'load'}" @click.prevent="selectNodeStatusTab('load')">DNS节点负载</a>
</div>

<div class="chart-box" id="cpu-chart" v-show="nodeStatusTab == 'cpu'"></div>
<div class="chart-box" id="memory-chart" v-show="nodeStatusTab == 'memory'"></div>
<div class="chart-box" id="load-chart" v-show="nodeStatusTab == 'load'"></div>